﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace paipai
{
    public partial class UserManagerUI : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            #region   session check & init
            if (!IsPostBack)
            {
                if (Session["UserID"] != null)
                {
                    ViewState.Add("UserID", Session["UserID"]);
                }
                else
                {
                    Response.Redirect("Login.aspx");
                }
            }
            #endregion
            
            var cUserBasic = Bll.CUserBasicManage.GetBasicUser(ViewState["UserID"].ToString());
            Label_Name.Text = cUserBasic.name;
            Label_Credit.Text = cUserBasic.rankID == 0 ? "normal" : (cUserBasic.rankID == 1 ? "VIP1" : "VIP2");
            Label_Mail.Text = "0/0"; 

            var cUserExtend = Bll.CUserExtendManage.GetExtendUser(ViewState["UserID"].ToString());
            Label_Ecash.Text = cUserExtend.eCash.ToString();
            Label_Bids.Text = cUserExtend.bid.ToString();
            Label_Fbids.Text = cUserExtend.freeBid.ToString();
        }
    }
}
